package com.gnerv.cms.entity;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * CMS平台-栏目表
 * </p>
 *
 * @author Gnerv LiGen
 * @since 2019-07-01
 */
@TableName("cms_catalog")
public class Catalog implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 业务主键
     */
    private String bId;

    /**
     * 上级业务主键
     */
    private String pId;

    /**
     * 栏目名称
     */
    private String name;

    /**
     * 状态
     */
    private Integer state;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 下级栏目列表
     */
    @TableField(exist = false)
    private List<Catalog> children = new ArrayList<>();

    public Catalog() {
    }

    public Catalog(String bId) {
        this.bId = bId;
    }

    public String getbId() {
        return bId;
    }

    public void setbId(String bId) {
        this.bId = bId;
    }

    public String getpId() {
        return pId;
    }

    public void setpId(String pId) {
        this.pId = pId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public List<Catalog> getChildren() {
        return children;
    }

    public void setChildren(List<Catalog> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
